package com.example.drive.net.callback

import android.util.Log
import okhttp3.Response

/**
 * 返回字符串
 */
abstract class StringCallback : NetworkCallback<String> {
    companion object {
        private const val TAG = "StringCallback"
    }

    override fun parseNetworkResponse(response: Response): String? {
        return kotlin.runCatching {
            response.body.string()
        }.getOrElse {
            Log.e(TAG, "parseNetworkResponse error:$it")
            ""
        }
    }
}